# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=radare2-unicorn
pkgver=920.1cf5851
pkgrel=1
pkgdesc='Unicorn Emulator Plugin for radare2.'
groups=('blackarch' 'blackarch-disassembler' 'blackarch-binary'
        'blackarch-reversing')
arch=('x86_64' 'aarch64')
url='https://github.com/radare/radare2-extras/tree/master/unicorn'
license=('GPL3')
depends=('radare2' 'unicorn' 'unicorn' 'yara' 'openssl' 'jansson' 'capstone')
makedepends=('git' 'pkg-config')
source=("$pkgname::git+https://github.com/radare/radare2-extras.git")
install="$pkgname.install"
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  ./configure --prefix=/usr

  make unicorn

  cd unicorn

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" unicorn-install
}

